import React from 'react'
import { useSelector, useDispatch } from 'react-redux';
import { stateType } from '../../types/types'
type Props = {}
export default function Father({ }: Props) {
    const state = useSelector((state: stateType) => state)
    console.log(state);
    const dispatch = useDispatch()
    return (
        <div>
            <p onClick={() => {
                dispatch({ type: '+' })
            }}>store:{state.count}</p>
            <p onClick={() => {
                dispatch({ type: 'add' })
            }}>
                store:{state.user.name} -- {state.user.age}
            </p>
        </div>
    )
}